/* R. J. Cano, Sep 6 2015 */

/* Some carpentry - Begin */
reversedVector(v)={my(w=vector(#v));for(j=1,#v,w[#v-j+1]=v[j]);w}
vecConcat(v1,v2)={my(v3=vector(#v1+#v2));for(j=1,#v1,v3[j]=v1[j]);for(j=1,#v2,v3[#v1+j]=v2[j]);v3}
repUnit(w,r)=sum(j=0,w-1,r^j);
vecToInt(v,r=10)=sum(j=1,#v,v[#v-j+1]*(r^(j-1)));
/* Some carpentry - End */

/* The Mathematical reason for all of this stuff... to ask for any 3-uple of primes if...*/
doTheySatisfy(X,Y,Z,T=10)={my(Q=reversedVector(vecConcat(digits(X,T),digits(Y,T))));((repUnit(#Q,T)+vecToInt(Q,T))==Z)}

main()={
/* Sample input data */
  my(A=2,B=7,C=83);

/* Sample input specification (free/arbitrary choice): */
  my(radix=10);

/* More carpentry - Begin */
  my(noYes=["No","Yes"], dontDo=["don't :-/","do! :-)"]);
/* More carpentry - Begin */

/* ...Showtime! */
  my(answer=doTheySatisfy(A,B,C,radix));
  print("\n\nPlease consider the following definition:\n\n\t\"Given three primes A, B, and C. If you concatenate A and B, reverse the digits in such concatenation and sum it with the repunit having the same size in digits, what you get is C\"; \n\n\tDoes it actually exist a 3-uple of primes (A,B,C) such that they satisfy the proposed definition?; \n\n\t..."noYes[answer+1]" at least ("A","B","C"), they "dontDo[answer+1]".\n\n");
}

main();